<script setup>
  import {ref, reactive} from 'vue'

  let parentMsg = ref('产品');
  let data = ref([
    {
      id: '1001',
      name: '可乐'
    },
    {
      id: '1002',
      name: '薯片'
    }
  ]);

</script>

<template>
  <div>
    <ul>
      <li v-for="item in data" :key="item.id">{{ item.name }}</li>
    </ul>

    <!-- 可选的第二个参数列表 -->
    <ul>
      <li v-for="(item, index) in data" v-bind:key="index">{{ parentMsg }} - {{ index }} - {{ item.name }}</li>
    </ul>
    
  </div>
</template>

<style scoped>
</style>
